let app = getApp();
Page({
  data: {
    moment: []
  },
  //跳转页面
  jumpMoeny(event) {
    var thisId = event.currentTarget.id, url = '';
    if (thisId == "button") {
      url = "/pages/mine/mine_Physical_accounts/Phy_buyBack/Phy_buyBack";
    } else if (thisId == "button") {
      url = "/pages/mine/mine_Physical_accounts/Phy_buyBack/Phy_buyBack";
    } 
     else{
      url = "/pages/mine/mine_Physical_money/Phy_money";
    }
    wx.navigateTo({ url: url });
  },
  jumpItem (event) {
    var url = "/pages/mine/mine_Physical_accounts/Phy_wine/Phy_wine";
    wx.navigateTo({ url: url });
  },
  listProductAccount(){
    app.post("listProducAccount").then((res)=>{
      this.setData({
        moment:res.data
      })
    })
  },
onLoad(){
  this.listProductAccount();
},
  //下拉
  onPullDownRefresh() {
    var $this = this;
    wx.showNavigationBarLoading();
    wx.showToast({
      title: '加载中...',
      icon: 'loading'
    });
    setTimeout(function(){
      $this.setData({
        moment: $this.data.moment
      });
      wx.stopPullDownRefresh();
      // 隐藏导航栏加载框
      wx.hideNavigationBarLoading();
    },1000);
  },
  //停止
  stopPullDownRefresh() {
    var $this = this;
    wx.stopPullDownRefresh({
      complete(res) {
        wx.hideToast()
      }
    });
  },
  /**
   * 页面上拉
   */
  // onReachBottom() {
  //   var $this = this;
  //   wx.stopPullDownRefresh({
  //     complete(res) {
  //       wx.hideToast()
  //     }
  //   });
  //   this.setData({
  //     moment: []
  //   });
  //   // 隐藏导航栏加载框
  //   wx.hideNavigationBarLoading();
  // }
})